from .base import Tool

def execute(params: dict) -> str:
    """执行ask_user工具"""
    try:
        question = params.get("question", "")
        if not question:
            return "错误：未提供问题内容"
        
        return question
        
    except Exception as e:
        return f"询问用户失败: {str(e)}"

TOOL = Tool(
    name="ask_user",
    description="向用户询问后续操作意图",
    parameters={
        "question": {
            "type": "string",
            "description": "要询问用户的问题",
            "required": True
        }
    },
    example='''<ask_user>
<question>文件已创建完成，需要我帮您打开吗？</question>
</ask_user>''',
    execute_func=execute
) 